package com.github.hwangrq.springboothomework.boot.controller;

import com.github.hwangrq.springboothomework.boot.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: hwangrq
 * @date: 2021/3/3 14:45
 * @description:
 */
@RestController
public class MyController {

    @Autowired
    private MyService myService;

    @GetMapping(value = "/test", produces = "text/html;charset=UTF-8")
    public String test() {
        String str = myService.test();
        System.out.println(str);
        return str;
    }

    @GetMapping(value = "/index", produces = "text/html;charset=UTF-8")
    public String index() {
        return "index";
    }

}
